#ifndef CTIMEAXIS_H
#define CTIMEAXIS_H

#include "CTimeAxis_global.h"
#include <QWidget>
#include <QPainter>
#include <QWheelEvent>
#include <QPainterPath>

QT_BEGIN_NAMESPACE
namespace Ui {
class Widget;
}
QT_END_NAMESPACE

class CTIMEAXIS_EXPORT CTimeAxis : public QWidget
{
    Q_OBJECT
public:
    CTimeAxis();

signals:
    void TimeChange(const QString & strCurTime);
protected:
    virtual void paintEvent(QPaintEvent *event);

    virtual void wheelEvent(QWheelEvent *event);

    virtual void mouseMoveEvent(QMouseEvent *event);
    virtual void mousePressEvent(QMouseEvent*);
    virtual void mouseReleaseEvent(QMouseEvent *event);
private:
    int m_nMultiple;
    bool m_bIsDragging;
    QPoint m_lastMousePos;
    qreal m_offset = 0;
    QString m_strCurTime;
    int m_nStepPx;//一像素代表多少时间timestep

    QString m_strStartTime;
    QString m_strEndTime;
};

#endif // CTIMEAXIS_H
